package cuit.epoch.pymjl.security.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 商家审批消息表
 * @TableName t_massage
 */
@TableName(value ="t_massage")
public class TMassage implements Serializable {
    /**
     * id
     */
    @TableId
    private String userid;

    /**
     * 用户昵称
     */
    private String content;

    /**
     * 信息
     */
    private String sender;

    /**
     * 时间
     */

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    public String getUserid() {
        return userid;
    }

    /**
     * id
     */
    public void setUserid(String userid) {
        this.userid = userid;
    }

    /**
     * 用户昵称
     */
    public String getContent() {
        return content;
    }

    /**
     * 用户昵称
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 信息
     */
    public String getSender() {
        return sender;
    }

    /**
     * 信息
     */
    public void setSender(String sender) {
        this.sender = sender;
    }

    /**
     * 时间
     */
    public Date getDate() {
        return date;
    }

    /**
     * 时间
     */
    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TMassage other = (TMassage) that;
        return (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getSender() == null ? other.getSender() == null : this.getSender().equals(other.getSender()))
            && (this.getDate() == null ? other.getDate() == null : this.getDate().equals(other.getDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getSender() == null) ? 0 : getSender().hashCode());
        result = prime * result + ((getDate() == null) ? 0 : getDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userid=").append(userid);
        sb.append(", content=").append(content);
        sb.append(", sender=").append(sender);
        sb.append(", date=").append(date);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
